home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / Asymptote Demo / Examples / Demos / 11) A465 chart / Demo11 < prev   
Encoding:
Text File  |  1994-05-07  |  1.5 KB  |  61 lines  |  [TEXT/DWat]

  1. graphunits cm
  2. graphframe 5 20 5 20
  3. fullscreen yes
  4.  
  5. % Read the data:
  6. datafile A465.dat
  7. readcolumn x 2
  8. readcolumn y 3
  9.  
  10. % Manipulate the data.
  11. % Shift the origin by (-180,-180).
  12. rpn <x 180 - >x
  13. rpn <y 180 - >y
  14.  
  15. graphlimits            % Find the limits of the data
  16.  
  17. graphaspect 1.0    % Specify that we want a graph with a square grid
  18.  
  19. pendash short        % Specify a dash pattern
  20. drawgrid false        % and draw a grid
  21.  
  22. drawframe            % Draw the frame around the graph
  23.  
  24. % Set the point symbols using values in the data file.
  25. % Read the data in column 4, take the log of these values
  26. % and use them to scale the size of each point:
  27. readcolumn p 4
  28. rpn <p log min - max / >p
  29.  
  30. % The p vector (which Asymptote uses for the point symbols)
  31. % now contains value between 0 and 1.  The fractional part
  32. % of the p vector is the symbol size
  33. % Next, read the data in column 5 and use it for the
  34. % point symbols (filled circle, etc).
  35. % You could also calculate the symbols (see the Asymptote 
  36. % User's guide for examples of this.)
  37. readcolumn e 5
  38. rpn <e <p + >p
  39.  
  40. pointsize 16        % Chose a size for the points and plot them
  41. plotpoints 
  42.  
  43. % Plot a label (read from column 1) next to each point.
  44. readcolumn l 1        % Read column 1 in to the L vector
  45. rpn <x 10 + >x        % Shift the labels a bit
  46. rpn <y .3 + >y
  47. scale .3            % Make the labels very small
  48. textmode inverted
  49. plotlabels aboveleft
  50. textmode
  51. scale .75
  52. drawxlabel Right Ascension Offset (arc seconds)
  53. drawylabel Declination Offset (arc seconds)
  54.  
  55. % Draw the title a bit larger
  56. scale 1.25
  57. drawtitle A465
  58.  
  59. % All done reading data so close the data window.
  60. closewindow \f
  61.